package com.tiantianyuegou.activity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.tiantianyuegou.R;
import com.tiantianyuegou.util.Tools;

/**
 * 安全中心
 */
public class MySecurityCentreActivity extends Activity implements View.OnClickListener {

    private ImageView img_title;
    private TextView text_title;
    private LinearLayout linear_login_pw, linear_pay_pw;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_my_security_centre);
        init();
        Tools.changeSystemBar(this);
    }

    private void init() {
        text_title = (TextView) findViewById(R.id.text_title);
        img_title = (ImageView) findViewById(R.id.img_title);
        text_title.setText(R.string.security_title);
        img_title.setOnClickListener(this);

        linear_login_pw = (LinearLayout) findViewById(R.id.linear_login_pw);
        linear_pay_pw = (LinearLayout) findViewById(R.id.linear_pay_pw);

        linear_login_pw.setOnClickListener(this);
        linear_pay_pw.setOnClickListener(this);
    }

    @Override
    public void onClick(View view) {

        switch (view.getId()) {
            case R.id.img_title:
                finish();
                break;
            case R.id.linear_login_pw:
                Intent linear_login_pw = new Intent();
                linear_login_pw.putExtra("id", "login");
                linear_login_pw.setClass(MySecurityCentreActivity.this, MyChangePassWordActivity.class);
                startActivity(linear_login_pw);
                break;

            case R.id.linear_pay_pw:
                Intent linear_pay_pw = new Intent();
                linear_pay_pw.putExtra("id", "pay");
                linear_pay_pw.setClass(MySecurityCentreActivity.this, MyChangePassWordActivity.class);
                startActivity(linear_pay_pw);

                break;

            default:

                break;
        }
    }
}
